# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netzob
pkgver=1.0.2
pkgrel=12
pkgdesc='An open source tool for reverse engineering, traffic generation and fuzzing of communication protocols.'
groups=('blackarch' 'blackarch-reversing' 'blackarch-fuzzer'
        'blackarch-networking')
arch=('x86_64' 'aarch64')
url='https://github.com/netzob/netzob/'
license=('GPL3')
depends=('python' 'python-gobject' 'gtk3' 'impacket' 'libxml2' 'libxslt'
         'python-lxml' 'graphviz' 'python-bitarray' 'python-jsonpickle'
         'python-netaddr' 'python-numpy' 'python-colorama' 'python-bintrees'
         'python-pcapy' 'python-werkzeug' 'python-pylstar' 'python-mock'
         'python-flask' 'python-arpreq')
makedepends=('python-setuptools')
source=("https://github.com/netzob/netzob/archive/Release/netzob-$pkgver.tar.gz")
sha512sums=('a56a1ab0a1066aa7825cabb475225756f0009a857d2c6c8d7ed8aba8753aec5f401ba0f170db6b6677875f7a0388e0443eee8fa3709d05b6e9f9e5c04f1c9f97')

build() {
  cd "$pkgname-Release-netzob-$pkgver/$pkgname"

  python setup.py build
}

package() {
  cd "$pkgname-Release-netzob-$pkgver/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" AUTHORS.txt README.rst \
    NEWS.rst

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  find "$pkgdir/usr/share" -type f -exec chmod 644 {} \;

  chmod 644 \
    "$pkgdir"/usr/lib/python*/site-packages/Netzob-${pkgver}-py*.egg-info/*
}

